﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net.Sockets;
using System.Xml;

namespace Sunny.Lib
{
    public class StreamHelper
    {
        FileStream fs;
        NetworkStream ns;
        MemoryStream ms;
        BufferedStream bs;
        Stream stream;

        StreamReader streamReader;
        StreamWriter streamWriter;
        StringReader stringReader;
        StringWriter stringWriter;
        TextReader textReader;
        TextReader textWriter;

        XmlTextReader xmlTextReader;
        XmlTextWriter xmlTextWriter;

        BinaryReader binaryReader;
        BinaryWriter binaryWriter;

        public void Demo(string context, Encoding encoding)
        {
            fs = new FileStream(@"D:\123.txt", FileMode.Create);
            streamWriter = new StreamWriter(fs, encoding);
            streamWriter.Write(context);
            streamWriter.Close();
        }
    }
}
